<template>
  <div>
    <el-card class="box-card" shodow="never">
      <div slot="header">
        <span>推广信息</span>
      </div>
      <p v-for="(item,index) in list" :key="index" class="block">
        <a :href="item.link" target="_blank">{{ item.title }}</a>
      </p>
    </el-card>
  </div>
</template>

<script>
import { getPromotionList } from "@/api/promotion";

export default {
  name: "Promotion",
  data() {
    return {
      list: []
    };
  },

  created() {
    this.fetchList();
  },

  methods: {
    fetchList() {
      getPromotionList().then(response => {
        const { data } = response;
        this.list = data;
      });
    }
  }
};
</script>